package org.hyf.inspur.LessonDesin.clear.count6;

import org.hyf.inspur.LessonDesin.clear.tools.TProperties;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class CountProMapper extends Mapper<LongWritable, Text,Text, Text>{
    protected void map(LongWritable key, Text value,
                       Mapper<LongWritable, Text, Text, Text>.Context context)
            throws IOException, InterruptedException {
        //String str[] = values.toString().split("|");
        String temp[]=value.toString().split(TProperties.getValue("fileoutsplit"));
        String wordNum=temp[0] +  "|" + temp[3];
        String num= 1 +  "|" + temp[2];
        context.write(new Text(wordNum),new Text(num));
    }
}
